package com.niuquan.activitie;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;

import com.niuquan.adapter.infoAdapter;
import com.niuquan.modal.Remind;

import java.util.ArrayList;

/**
 * Created by DELL on 2015/5/24.
 */
public class InvitedClass extends Activity {
    private ListView lv;
    private ArrayList<Remind> appListSend;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.layout_invited);
        appListSend = new ArrayList<Remind>();
        //List<PackageInfo> packages = getPackageManager().getInstalledPackages(0);
    //    for (int i = 0; i < 10; i++) {

            Remind test = new Remind();
            test.setCoins("12");
            test.setPublisher("publisher");
            test.setTime("12:00");
            test.setTitle("Title");
            appListSend.add(test);
    //    }

        lv = (ListView) findViewById(R.id.listview);
        updateList();

    }
    public void updateList() {

        infoAdapter adapter = new infoAdapter(getApplicationContext(), appListSend);
        lv.setAdapter(adapter);
        lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view,
                                    int position, long id) {
            }
        });

    }
}
